home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1833 / 1833.xpi / chrome / m / yoono.com / sidebar.jar / sidebar / js / popupHelper.js < prev    next >
Text File  |  2009-12-16  |  3KB  |  1 lines

  1. var popupTimer=null;function PopupHelper(c,d,b,e){if(!c){return}yoono.require(["yoono.event","yoono.localization"]);this.popup=c;if("YLanguages" in window){this.languages=window.YLanguages}this.locale=YServices.env.getLocale();yoono.localization.translateDocument(document,this.languages);YTools.initHover();YTools.initTooltips(this.languages);this._closeQueryHandler=b;var a=this;yoono.event.addEventListener(document,"keydown",function(f){a.checkKey(f)});if(d){this.throbber=new ThrobberCtrl(d)}if(yoono.env.IE){document.body.style.height=document.documentElement.offsetHeight+"px"}if(!e){YServices.skin.applyToDocument(document,"",true)}YServices.skin.applyTextSizeToDocument(document)}PopupHelper.prototype.translateText=function(a){return yoono.localization.translate(a,this.languages)};PopupHelper.prototype.translateId=function(a){return yoono.localization.translateId(a,this.languages)};PopupHelper.prototype.translateTemplate=function(b,a){return yoono.localization.translateTemplateAndEval(b,a,this.languages)};PopupHelper.prototype.checkKey=function(a){if(a.keyCode==27){if(!this._closeQueryHandler||this._closeQueryHandler.canClose()){if("closePop" in window){closePop()}else{window.close()}}}};PopupHelper.prototype.throb=function(a){if(!this.throbber){return}if(a){this.throbber.play()}else{this.throbber.stop()}};PopupHelper.prototype.setAutoCloseHandlers=function(){var a=this;yoono.event.addEventListener(document.body,"mouseover",function(b){a.stopClosing(b)});yoono.event.addEventListener(document.body,"mouseout",function(b){a.startClosing(b)})};PopupHelper.prototype.startClosing=function(){try{var a=this;if(window.popupTimer){clearInterval(window.popupTimer)}window.popupTimer=setTimeout(function(){YServices.log.debug("startClosing:close!");a.close()},750)}catch(b){alert("startClosing :"+b)}};PopupHelper.prototype.stopClosing=function(a){try{if(YTools.isMac()){if("HTML"==a.target.localName){return}if("BODY"==a.target.localName){return}}if(window.popupTimer){clearInterval(window.popupTimer)}}catch(b){alert("stopClosing :"+b)}};PopupHelper.prototype.close=function(b){if(window.onPopupHelperClose){if(window.onPopupHelperClose()){return}}if(!b){var a=this;setTimeout(function(){a.close(true)},10)}if(Prototype.Browser.IE){window.opener="X";window.external.close("")}else{window.close()}};PopupHelper.prototype.closeNew=function(b){try{if(window.onPopupHelperClose){if(window.onPopupHelperClose(true)){return}}}catch(c){}if(!b||b==undefined){var a=this;setTimeout(function(){a.closeNew(true)},10);return}if(yoono.env.IE){window.opener="X";try{window.external.close("")}catch(c){}}else{window.close()}};